package com.student.demo.service;

import java.util.List;

import javax.annotation.Resource;
import javax.transaction.Transactional;

import org.springframework.stereotype.Service;

import com.student.demo.entity.NianJiZhuanYe;
import com.student.demo.repository.NianJiZhuanYeRepository;

@Service
public class NianJiZhuanYeService {
	
	@Resource
	private NianJiZhuanYeRepository nianJiZhuanYeRepository;
	
	
	@Transactional
	public NianJiZhuanYe addNianJiZhuanYe(NianJiZhuanYe nianJiZhuanYe) {
		return nianJiZhuanYeRepository.save(nianJiZhuanYe);
	}
	
	@Transactional
	public void deleteNianJiZhuanYe(Integer id) {
		nianJiZhuanYeRepository.deleteById(id);
	}
	
	
	public List<NianJiZhuanYe> findAll() {
		return nianJiZhuanYeRepository.findAll();
	}
	

}
